package com.noble.library.camera.util;

import android.os.Environment;

import java.io.File;

/**
 * 相机文件路径
 */
public class FileUtil {
    // 获取拍照临时的缓存文件
    public static File getPhotoCacheFile() {
        File fileDir = new File(Environment.getExternalStorageDirectory().getAbsolutePath() + "/meet");
        if (!fileDir.exists()) {
            fileDir.mkdirs();
        }

        return new File(fileDir.getPath() + File.separator + "IMG_" + System.currentTimeMillis() + ".jpg");
    }

    // 获取视频临时的缓存文件
    public static File getVideoCacheFile() {
        File fileDir = new File(Environment.getExternalStorageDirectory().getAbsolutePath() + "/meet");
        if (!fileDir.exists()) {
            fileDir.mkdirs();
        }

        return new File(fileDir.getPath() + File.separator + "VIO_" + System.currentTimeMillis() + ".mp4");
    }
}
